package com.aaa.controller;

import com.aaa.entity.ContractLease;
import com.aaa.entity.Result;
import com.aaa.query.ContractQuery;
import com.aaa.service.IContractLeaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：李世磊
 * @date ：Created in 2021/1/27 15:48
 * @description： 公有资产租出合同控制器
 * @modified By：
 * @version: 1.0
 */
@RestController
@RequestMapping("/leasePublic")
public class ContractLeasePublicController {

    @Autowired
    IContractLeaseService service;

    /**
     * 公有资产租出合同 查询所有
     */

    @RequestMapping("/listAllPublic")
    public Result listAllPublic(){

        return service.listAllPublic();
    }

    /**
     *  公有资产租出合同 添加合同
     * @param contract
     */

    @RequestMapping("/add")
    public Result addLeasePublic(@RequestBody ContractLease contract){

        return service.addLeasePublic(contract);
    }

    /**
     *  公有资产租出合同  修改合同
     * @param contract
     */
    @RequestMapping("/update")
    public Result updateLeasePublic(@RequestBody ContractLease contract){

        return service.updateLease(contract);
    }

    /**
     *  公有资产租出合同 分页+模糊查询
     * @param  query
     * @return
     */

    @PostMapping("/query")
    public Result LeasePublicQuery(@RequestBody ContractQuery query){

        return service.LeasePublicQuery(query);

    }


}
